import React, { FC } from 'react';
import Tabs from './Tabs'
import { connect } from 'umi';
import WindowState from './WindowState'
import ToolBar from './ToolBar'
import './BrowserHeader.css'
const BrowserHeader = ({ addressBarVisible }) => {
    return (
        <div className="browser-header d-flex flex-column">
            <div className="browser-header-title d-flex">
                <div className="browser-tabs flex-grow-1" >
                    <Tabs />
                </div>
                <div className="browser-window-state"><WindowState /></div>
            </div>

            <div className="tool-bar-wrapper m-1">
                <ToolBar />
            </div>
        </div>
    )
}

const mapStateToProps = ({ tabs }) => {
    return {
        addressBarVisible: tabs.activeWindowId != 0
    }
}
export default connect(mapStateToProps)(BrowserHeader);